package com.itheima.d5_tcp2;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException {

        final Socket socket = new Socket("192.168.49.16",6666);



        while (true) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入要发送的消息");

            String msg = scanner.nextLine();

            final OutputStream netOut = socket.getOutputStream();

            final DataOutputStream dos = new DataOutputStream(netOut);

            dos.writeUTF(msg);
            if(msg.equals("886")){
                break;
            }
        }

    }
}
